Imports System.Drawing

Namespace Overlay.Series
    ''' <summary>
    ''' The jChart.Overlay.Series.ScatterSeries object describes a single area series. Series are added to 
    ''' jChart.OverLay.ScatterSeries objects which, in turn, are added to the jChart.GraphChart object. 
    ''' Each series represents a set of values and the type of chart that should be used to display those values.
    ''' </summary>
    ''' <remarks></remarks>
    Public Class ScatterSeries
        Implements iSeries

        Protected msName As String
        Protected moColor As Color
        Protected msnOpacity As Single = 1

        Protected msnXValue As Single
        Protected msnYValue As Single

        Protected miIndicatorHeight As Integer = 10
        Protected miIndicatorWidth As Integer = 10

        Protected moIndicator As Indicator

        ''' <summary>
        ''' Indicator is a jChart.Indicator object that describes the graphic that should be displayed at each value point in the line chart.
        ''' </summary>
        ''' <param name="oIndicator"></param>
        ''' <remarks></remarks>
        Public Sub New( _
            ByVal oIndicator As Indicator)

            moIndicator = oIndicator
            moColor = oIndicator.Color
            miIndicatorHeight = moIndicator.IndicatorHeight
            miIndicatorWidth = moIndicator.IndicatorWidth
            msnOpacity = moIndicator.Opacity
        End Sub

        ''' <summary>
        ''' X value of the datapoint represented by this series.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property XValue() As Single
            Get
                Return msnXValue
            End Get
            Set(ByVal value As Single)
                msnXValue = value
            End Set
        End Property

        ''' <summary>
        ''' Y value of the datapoint represented by this series.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property YValue() As Single
            Get
                Return msnYValue
            End Get
            Set(ByVal value As Single)
                msnYValue = value
            End Set
        End Property

        ''' <summary>
        ''' Indicator is a jChart.Indicator object that describes the graphic that should be displayed at each value in the series.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Indicator() As Indicator
            Get
                Return moIndicator
            End Get
            Set(ByVal value As Indicator)
                moIndicator = value
            End Set
        End Property

        ''' <summary>
        ''' Sets or gets the name of the series. This value is be returned, along with the value, 
        ''' when the user clicks on a chart as part of drill-down functionality.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Name() As String _
            Implements iSeries.Name

            Get
                Return msName
            End Get
            Set(ByVal value As String)
                msName = value
            End Set
        End Property

        ''' <summary>
        ''' The color of the series
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Color() As Color _
            Implements iSeries.Color

            Get
                Return moColor
            End Get
            Set(ByVal value As Color)
                moColor = value
            End Set
        End Property

        ''' <summary>
        ''' The amount of transparency of the series. A value of 1 is opaque and a value of 0 is transparent.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Opacity() As Single _
            Implements iSeries.Opacity

            Get
                Return msnOpacity
            End Get
            Set(ByVal value As Single)
                msnOpacity = value
            End Set
        End Property

        ''' <summary>
        ''' Overrides the diameter of this element. Series uses indicator size as default
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property IndicatorHeight() As Integer
            Get
                Return miIndicatorHeight
            End Get
            Set(ByVal value As Integer)
                miIndicatorHeight = value
            End Set
        End Property

        ''' <summary>
        ''' This is the dimension, in pixels, of the indicator. Write-only.
        ''' </summary>
        ''' <value></value>
        ''' <remarks>Default is 10. To retrieve the current indicator size use the IndicatorWidth and IndicatorHeight properties</remarks>
        Public WriteOnly Property IndicatorSize() As Integer
            Set(ByVal value As Integer)
                miIndicatorWidth = value
                miIndicatorHeight = value
            End Set
        End Property

        ''' <summary>
        ''' Overrides the diameter of this element. Series uses indicator size as default
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property IndicatorWidth() As Integer
            Get
                Return miIndicatorWidth
            End Get
            Set(ByVal value As Integer)
                miIndicatorWidth = value
            End Set
        End Property

        Friend ReadOnly Property AlphaValue() As Integer
            Get
                Return msnOpacity * 255
            End Get
        End Property
    End Class
End Namespace